package com.agranee.timesheet.service;

import javax.faces.bean.ManagedProperty;

import org.springframework.transaction.annotation.Transactional;

import com.agranee.timesheet.dao.EmployeeDao;
import com.agranee.timesheet.daoable.Employeable;
import com.agranee.timesheet.model.Employee;
import com.agranee.timesheet.serviceable.EmployeeServiceable;

@Transactional(readOnly=true)
public class LoginService implements EmployeeServiceable {
  // Employeable employeeable;
	@ManagedProperty(value="#{employeeDao}")
	private EmployeeDao employeeDao;

	/*public Employeable getEmployeeDao() {
		return employeeable;
	}



	public void setEmployeeDao(Employeable employeeable) {
		this.employeeable = employeeable;
	}*/



	@Override
	public Employee getUserByUserId(String employeeUserId) {
		//employeeDao=new EmployeeDao();
		return getEmployeeDao().getEmployeeByUserId(employeeUserId);
		
		
	}

	public EmployeeDao getEmployeeDao() {
		return employeeDao;
	}

	public void setEmployeeDao(EmployeeDao employeeDao) {
		this.employeeDao = employeeDao;
	}

}
